<form id="productsForm" action="<c:url value="/products/${product.id}" />" method="POST">
	<fieldset>
		<legend>Edit Product</legend>
		
		<img alt="${product.name}" src="<c:url value="/products/${product.id}/image" />" width="100" height="100" />
		<a href="<c:url value="/products/${product.id}/image" />">Download Imagem</a>
		
		<input type="hidden" name="product.id" value="${product.id}"/>
		<label for="name">Name:</label>
		<input id="name" type="text" name="product.name" value="${product.name}"/>
		
		<label for="description">Description:</label>
		<input id="description" type="text" name="product.description" value="${product.description}"/>
		
		<label for="price">Price:</label>
		<input id="price" type="text" name="product.price" value="${product.price}"/>
		
		<button type="submit" name="_method" value="PUT">Send</button>
	</fieldset>
</form>

<form action="<c:url value="/products/${product.id}/image"/>" method="POST" enctype="multipart/form-data">
	<fieldset>
		<legend>Image upload</legend>
		<input type="file" name="image" />
		
		<button type="submit">Upload</button>
	</fieldset>
</form>

<script type="text/javascript">
$("#productsForm").validate({
	rules: {
		"product.name": {
			required: true,
			minlength: 3
		},
		"product.description" : {
			required: true,
			minlenght: 40
		},
		"product.price": {
			min: 0.0
		}
	}
	
});
</script>